#encoding: UTF-8
module ApplicationHelper

    def add_producto_link(text, producto)
        link_to text, {
                                :url => {
                                    :controller => "cart",
                                    :action => "add",
                                    :id => producto}, :remote => true
                            },
                            {
                                :title => "Añadir al carrito",
                                 :href => url_for( :controller => "cart",
                                                  :action => "add",
                                                  :id => producto)
                             }
    end

    def remove_producto_link(text, producto)
          link_to text, {
                                  :url => {
                                      :controller => "cart",
                                      :action => "remove",
                                    :id => producto}, :remote => true
                            },
                            {
                                :title => "Eliminar producto",
                                  :href => url_for( :controller => "cart",
                                                    :action => "remove",
                                                    :id => producto)
                              }
    end

    def clear_cart_link(text)
          link_to text, {
                                  :url => {
                                              :controller => "cart",
                                              :action => "clear" }, :remote => true
                              },
                            {
                                :href => url_for(
                                            :controller => "cart",
                                              :action => "clear")
                            }
    end

#  def display_tags(producto)
#    producto.tags.collect{|tag| link_to tag.name, :controller => '/tag', :action => 'show', :id => tag.name }.join(", ") if producto.tags
#  end


end
